package com.fpost.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

import com.fpost.ajax.Result;
import com.fpost.ajax.ResultBasedAction;
import com.fpost.ajax.TextResult;
import com.fpost.form.AjaxTestForm;

public class TestAjaxAction extends ResultBasedAction {

	public Result execute(ActionMapping mapping, ActionForm form, HttpServletRequest request) throws Exception {
	
		AjaxTestForm testAjaxForm = (AjaxTestForm) form;
		
		String ret = null;
		String param = (String) request.getParameter("param");
		if(param != null && param.equals("one")  ){
			//testAjaxForm.setItem("Hello!");
			ret = "Hello!";
		}
		return new TextResult(ret);	 

	}

}
